/**
 *
 * @type {{'组件类型': {
 * title(标题): string,
 * showTitle(展示标题): boolean,
 * styles(风格): {},
 * dataSources(数据来源): {},
 * advancedConf(高级配置): {}
 * }}}
 */
import {I18Parse} from '@lowcode/jpaas-base-lib';
import defConfigLang from '@/language/lang/impl/design/def-config-lang.js';
const lang = defConfigLang;
const i18n=function (langKey,text) {
	return I18Parse.getI18Val(lang.defConfigLang,langKey, text)
}

export const defConfig = {
	'text':{
		key:"",
		title:"",
		showTitle:false,
		styles:{},
		titleStyle:{},
		dataSources:{
			source:"static",
			content:i18n('modifyText','点击修改文字'),
			fontSize:16,//文本字体大小
			titleColor:'#ffffff',//文本字体颜色
			fontWeight:'normal',//文本是否加粗
			textAlign:'left',//文本对齐方式
			neonLightShow:false,//是否开启霓虹灯
			neonLightColor:'#4285f4',//霓虹灯颜色
			dataModel: "",
			dataModelName:"",
			measures:[]
		},
		advancedConf:{
			openLink:false,
			linkUrl:"",
			linkMode:"newWindow",
			textColor:"#1890ff",
			underline:false
		}
	},
	'quillEditor':{
		key:"",
		title:"",
		showTitle:false,
		styles:{},
		titleStyle:{},
		dataSources:{
			source:"static",
			content:"",
			dataModel: "",
			dataModelName:"",
			measures:[]
		},
		advancedConf:{}
	},
	'realTime':{
		key:"",
		title:"",
		showTitle:false,
		styles:{},
		titleStyle:{},
		dataSources:{
			format:"YYYY-MM-DD",
			showWeek:true,
			fontSize:16,//时间字体大小
			titleColor:'#ffffff',//时间字体颜色
			fontWeight:'normal',//时间是否加粗
			textAlign:'left',//时间对齐方式
		},
		advancedConf:{}
	},
	'weather':{
		key:"",
		title:"",
		showTitle:false,
		styles:{
			temperatureStyle:{
				fontSize:20,
				color:'#bad4ff',
				fontWeight:'normal',
			},
			otherStyle:{
				fontSize:14,
				color:'#bad4ff',
				fontWeight:'normal',
			},
			template:2,
		},
		titleStyle:{},
		dataSources:{},
	},
	'chart':{
		key:"",
		title:"",
		showTitle:false,
		//类型
		chartType: "",
		styles:{},
		titleStyle:{},
		dataSources:{
			source:"static",//static dynamic
			staticData:"",
			dataModel: "",
			dataModelName:"",
			sourceType:"",
			//维度
			dimensions: [],
			// 度量
			measures: [],
			//颜色图例
			colorLegends: [],
			resultNum:1000
		},
		advancedConf:{
			//联动开关
			linkage:false,
			//接收参数
			receive:{
				type:"",
				publishComponent:"",
				mapping:[]
			},
			//发布参数
			publish:{
				paramMapping:[]
			},
			//下钻配置
			drillDownConfig:{
				isDrillDown:false,
				configs:[]
			},
		}
	},
	'image':{
		key:"",
		title:"",
		showTitle:false,
		styles:{},
		dataSources:{},
	},
	'iconfont':{
		key:"",
		title:"",
		showTitle:false,
		styles:{},
		dataSources:{
			icon:'icon-colorzuhe',
			color:'#ffb74d',
			fontSize:20
		},
	},
	'map':{
		key:"",
		title:"",
		showTitle:false,
		styles:{
			mapType:"china",
			province:"",
			showVisual:true,
			showLabel:true,
			tooltipShow:true,
			showShadow:true,
			tooltipConfig:{
				raBgColor:'rgb(5,5,5,1)',
				borderColor:"#283161",
				borderWidth:1,
				padding:"5,5,5,5",
				fontSize:12,
				fontColor:"#FFFFFF",
				fontStyle:"normal"
			}
		},
		//类型
		chartType: "map",
		titleStyle:{},
		dataSources:{
			dataModel: "",
			dataModelName:"",
			source:"dynamic",//static dynamic
			staticData:"",
			//地址字段
			dimensions: [],
			//值
			measures: [],
			sourceType:"",
			//用于切换时不报错
			colorLegends: [],
		},
		advancedConf:{
			//联动开关
			linkage:false,
			//接收参数
			receive:{
				type:"",
				publishComponent:"",
				mapping:[]
			},
			//发布参数
			publish:{
				paramMapping:[]
			},
			//下钻配置
			drillDownConfig:{
				isDrillDown:false,
				configs:[]
			},
		}
	},
	'table':{
		key:"",
		title:"",
		showTitle:false,
		styles:{
			stylesHead:{
				headBgColor:"rgb(66,133,244,0.6)",
				fontStyle:"bold",
				fontColor:"#FFFFFF",
				fontSize:13,
			},
			stylesCommon:{
				cutOffRuleColor:'rgba(66,133,244,0.7)',//分割线颜色
				cutOffRuleShow:false,//是否展示分割线
				fontColor:'#FFFFFF',//字体颜色
				fontSize:13,
				listDiction:'1',//短句几行显示
				listAligning:'center',//对齐方式
				listZebraShow:true,
				listZebraColor:'rgb(66,133,244,0.2)',//斑马纹颜色
				paging:false,//是否分页
				pageSize:10,//分页大小
				serial:true,//是否显示序号
				roll:true,//是否滚动
				speed:10,
			},
			advanced:{
				location:'nome',//统计位置
				list:[{
					statistics:'',
					page:false,
					polymerization:'',
					format:{}
				}],
			}
		},
		dataSources:{
			source:"dynamic",
			staticData:"",
			dimensions:[]
		},
		advancedConf:{
			//联动开关
			linkage:false,
			//接收参数
			receive:{
				type:"",
				publishComponent:"",
				mapping:[]
			},
			//发布参数
			publish:{
				paramMapping:[]
			}
		}
	},
	'numerical':{
		key:"",
		title:"",
		showTitle:false,
		chartType:'numerical',
		styles:{
			stylesCommon:{
				nndicatorStyle:1,//指标风格
				background:'rgba(66,133,244,0.2)',//指标卡块背景色
				borderShow:true,//指标块边框
				borderColor:'rgba(66,133,244,0.2)',//边框颜色
				borderNumber:1,//边框粗细
				display:'tile',//展开形式
				lineNumber:2,//行最多几个
				mobileLineNumber:1,//移动端行个数
				interval:10,//间距
				textAlign:'left',//内容在指标卡中间位置
				lineInterval:'moderation',//内容在指标卡中间位置
				style:[
					{
						name:i18n('dimension','维度'),
						color:'#FFFFFF',
						fontSize:17,
						fontWeight:'bold'
					},{
						name:i18n('primaryName','主指标名称'),
						color:'#FFFFFF',
						fontSize:13,
						fontWeight:'normal'
					},{
						name:i18n('principalValue','主指标数值'),
						color:'#FFFFFF',
						fontSize:24,
						fontWeight:'bold'
					},{
						name:i18n('subindexName','次指标名称'),
						color:'#FFFFFF',
						fontSize:12,
						fontWeight:'normal'
					},{
						name: i18n('subindexValue','次指标数值'),
						color:'#FFFFFF',
						fontSize:12,
						fontWeight:'normal'
					}
				],
				iconShow:true,
				iconLocation:'left',//图标位置
				iconLIist:[
					{
						icon:'icon-fillemoji_fill',
						system:'lineage',
						color:'linear-gradient(0deg,#2b76f3 0%,#6db6fb 100%)'
					}

				]
			}
		},
		titleStyle:{},
		dataSources:{
			source:"dynamic",
			staticData:"",
			dataModel: "",
			dataModelName:"",
			sourceType:"",
			//维度
			dimensions: [],
			// 度量
			measures: [],
		},
		advancedConf:{
			//联动开关
			linkage:false,
			//接收参数
			receive:{
				type:"",
				publishComponent:"",
				mapping:[]
			},
			//发布参数
			publish:{
				paramMapping:[]
			}
		}
	},
	'filter':{
		key:"",
		title:"",
		showTitle:false,
		styles:{
			layout:"standard",
			showButton:true,
			fontSize:14,
			titleColor:'#FFFFFF',

		},
		titleStyle:{},
		dataSources:{},
		advancedConf:{
			publish:{
				paramMapping:[]
			}
		}
	},
	'video':{
		key:"",
		title:"",
		showTitle:false,
		styles:{},
		titleStyle:{},
		dataSources:{
			auto:true,
			loop:true,
			videoId:'',
			videoName:'',
		},
	},
	'custom':{
		key:"",
		title:"",
		showTitle:false,
		//组件名
		customName:"",
		styles:{},
		titleStyle:{},
		//属性
		props:{

		},
		//事件
		events:{

		}
	},
}

export default defConfig;
